//wheel.txt - A wheel that opens/closes nearby gates.
//Cell 0 - The strength necessary to open the gate. One pc has to have it.
// Cell 1 - Range of open gates, if left at 0, range is 4

beginobjectscript; // door lever

variables;

short range = 4;

body;


beginstate INIT_STATE;

	if (get_memory_cell(1) != 0)
		range = get_memory_cell(1);
	break;

beginstate DEAD_STATE;

break;

beginstate START_STATE; 

break;

beginstate USE_STATE;
	if (get_memory_cell(0) >= 90) {
		print_str("Turn Wheel: You don't manage to turn the wheel. It is locked in position.");
		print_str("  You can't figure out how to unlock it.");
		end();
		}
		
	if (get_highest_stat(0) < get_memory_cell(0)) {
		print_str("Turn Wheel: You don't manage to turn the wheel. You aren't strong enough.");
		end();
		}

	broadcast_object_message(range,105);
	print_str_color("Turn Wheel: You turn the wheel.",2);
	pc_heard_sound(28);
break;

beginstate UNLOCK_STATE;
	print_str_color("Unlock Spell: The spell doesn't affect wheels.",1);	
break;
